package manong.mapper;

import manong.beans.Speciality;
import manong.beans.SpecialityQuery;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.session.RowBounds;

import java.util.List;
@Mapper
public interface SpecialityMapper {
  
    long countByExample(SpecialityQuery example);

   
    int deleteByExample(SpecialityQuery example);

    @Delete({
        "delete from speciality",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into speciality (spe_name, spe_describe, ",
        "statu, mark)",
        "values (#{speName,jdbcType=VARCHAR}, #{speDescribe,jdbcType=VARCHAR}, ",
        "#{statu,jdbcType=INTEGER}, #{mark,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(Speciality record);

  
    int insertSelective(Speciality record);

   
    List<Speciality> selectByExampleWithRowbounds(SpecialityQuery example, RowBounds rowBounds);

    
    Speciality selectOneByExample(SpecialityQuery example);

    List<Speciality> selectByExample(SpecialityQuery example);

   
    @Select({
        "select",
        "id, spe_name, spe_describe, statu, mark",
        "from speciality",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("manong.mapper.SpecialityMapper.BaseResultMap")
    Speciality selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Speciality record, @Param("example") SpecialityQuery example);

    
    int updateByExample(@Param("record") Speciality record, @Param("example") SpecialityQuery example);

    
    int updateByPrimaryKeySelective(Speciality record);

    @Update({
        "update speciality",
        "set spe_name = #{speName,jdbcType=VARCHAR},",
          "spe_describe = #{speDescribe,jdbcType=VARCHAR},",
          "statu = #{statu,jdbcType=INTEGER},",
          "mark = #{mark,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Speciality record);

   
    int insertOrUpdate(Speciality record);

  
    int insertOrUpdateSelective(Speciality record);

    
    int batchInsert(@Param("list") List<Speciality> list);

    int batchInsertSelective(@Param("list") List<Speciality> list, @Param("selective") Speciality.Column ... selective);
}